import Opt from '@/components/dt/info/Opt.js'
import houseOpt from '@/biz/option/house.js'
import organizationOpt from '@/biz/option/organization.js'

class SearchOpt extends Opt {
  
  constructor() {
    super()
    this.build()
  }
  
  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      organizationOpt.create({
        key: 'orgIds'
      }),
      houseOpt.create({
        to: (info) => {
          return {
            housesId: info.housesId
          }
        }
      }),
      {
        title: '案场状态',
        placeholder: '全部',
        key: 'status',
        select: {
          key: 'buildStatus',
          clearable: true
        }
      },
      {
        title: '财务状态',
        placeholder: '全部',
        key: 'settlementStatus',
        select: {
          key: 'financialStatus',
          clearable: true
        }
      },
    ]
  }
}

export default SearchOpt
